package com.yb.mini.order.controller;

import com.yb.mini.common.common.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单服务
 * @author yangbiao
 * @date: 2024/03/14
 */
@RestController
@RequiredArgsConstructor
public class OrderController {
    private final Environment environment;

    @GetMapping("/yb/order/{content}")
    public Result<Object> order(@PathVariable String content) {
        return Result.success("H---hell0----" + content);
    }

    @GetMapping("/yb/order1")
    public Result<Object> order1() {
        final String content = environment.getProperty("yb.nacos.config", String.class, "空内容");
        return Result.success("H---hell0----" + content);
    }

}
